package com.liu.serialization;

/**
 * @param
 * @BelongsProject: MessageQueueDEMO
 * @BelongsPackage: com.liu.producer.Serialization
 * @author: L
 * @Date: 2023/10/15 1:21
 * @return
 */

public enum SerializationTypeEnum {
    JSON((byte) 1);

    private byte type;

    public byte getType() {
        return type;
    }

    public static SerializationTypeEnum get(byte type){
        for (SerializationTypeEnum vale:values()){
            if (vale.type==type){
                return vale;
            }
        }
        throw new RuntimeException("未知类型: " + type);
    }

    SerializationTypeEnum(byte type) {
        this.type = type;
    }
}
